HAL OSPI migration: List of applicable concepts ¶
This section provides information about the HAL OSPI applicable architecture concepts.
Concepts for OSPI ¶
|
Concept |
Description |
|---|---|
|
The initialization has been split into separate init and config functions:
|
|
|
Removal and conversion of init structure to configuration structure |
The init structure
|
|
The handle structure has been renamed to
|
|
|
The
|
|
|
The functions
|
|
|
New APIs have been introduced to get and set XSPI features. |
|
|
In HAL2, DMA link APIs are provided with explicit naming and parameters :
|
|
|
Two functions are available to set and get user data:
|
|
|
Individual callback registration APIs replace global register and unregister functions |
The callback registration is handled by specific functions for each OSPI event. These functions are used to register callback functions for different OSPI events. |
|
All hardware macros have been removed from the HAL OSPI driver, and equivalent services are ensured through the LL APIs. |
|
|
The OSPI state machine is reworked to ensure transitions of the peripheral functional states. |
|
|
The HAL OSPI functions were updated to return:
|
|
|
Add a dedicated function for Error management:
|
|
|
All TypeDef parts of the HAL OSPI driver have been removed and replaced by
|
|
|
Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable. |
|
|
The parameters and state are checked using
|
|
|
Add HAL PPP Services for Drivers with Handle to Retrieve Corresponding Peripheral Clock Frequency. |
The HAL XSPI driver provides a new API to retrieve the clock frequency:
|
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including OSPI instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety. |
Other HAL OSPI changes ¶
|
Concept |
Description |
|---|---|
|
Split timing fields and memory characteristic fields in the global configuration structure. |
User can reconfigure only timing values according to application needs (example : High speed then low speed). |
|
Provide unitary configuration to get
|
|
|
Split the usage of Hyperbus APIs and regular APIs |
Dedicated APIs are provided:
|